package com.huixh.train.member.req;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.huixh.train.common.req.PageReq;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;

import java.util.Date;

/**
 * @author huixh
 */
public class PassengerQueryReq extends PageReq {
    private Long id;

    private Long memberId;
    private String name;
    @Size(min = 18, max = 18, message = "身份证长度必须为18位")
    private String idCard;
    @Pattern(regexp = "^[012]*$", message = "乘客类型不匹配")
    private String type;


    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    public PassengerQueryReq() {
    }

    public PassengerQueryReq(Long id, Long memberId, String name, String idCard, String type, Date createTime, Date updateTime) {
        this.id = id;
        this.memberId = memberId;
        this.name = name;
        this.idCard = idCard;
        this.type = type;
        this.createTime = createTime;
        this.updateTime = updateTime;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getMemberId() {
        return memberId;
    }

    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIdCard() {
        return idCard;
    }

    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "PassengerQueryReq{" +
                "id=" + id +
                ", memberId=" + memberId +
                ", name='" + name + '\'' +
                ", idCard='" + idCard + '\'' +
                ", type='" + type + '\'' +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                '}';
    }
}
